

ALTER PROCEDURE [dbo].[GetTopClientForAdmin]
	-- Add the parameters for the stored procedure here
	@AdminId INT
	
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
    -- Insert statements for procedure here	
	SELECT TOP(5)
	c.Id, (c.Firstname + '  ' + c.Lastname) as FullName,c.Limit
    FROM Client c
	WHERE c.IsActive =1 and c.IsDeleted = 0 and c.AdminId=@AdminId
	ORDER BY c.Limit;
	
END



ALTER PROCEDURE [dbo].[GetTopClientForSuperAdmin]
	-- Add the parameters for the stored procedure here
	
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
    -- Insert statements for procedure here	
	SELECT TOP(5)
	c.Id, (c.Firstname + '  ' + c.Lastname) as FullName,c.Limit
    FROM Client c
	WHERE c.IsActive =1 and c.IsDeleted = 0
	ORDER BY c.Limit;
	
END

ALTER PROCEDURE [dbo].[GetUpComingMatches]  
 -- Add the parameters for the stored procedure here  
   
AS  
BEGIN  
 -- SET NOCOUNT ON added to prevent extra result sets from  
 -- interfering with SELECT statements.  
 SET NOCOUNT ON;  
    -- Insert statements for procedure here  
   
 Select ms.Id, t.TeamName as Team1 ,t1.TeamName as Team2, Cast(Date as date) as Date, Time from MatchSchedule ms  
 INNER JOIN Team t on ms.Team1 = t.Id  
 INNER JOIN Team t1 on ms.Team2 = t1.Id  
 WHERE ms.IsActive = 1 and ms.IsDeleted = 0  and ms.Date >= GETUTCDATE()
   
END  